From: Owen W. Taylor Date: Thu, 6 Aug 2009 20:39:15 +0000 (-0400) Subject: Fix compiler warnings X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~11147 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d2436346023de303ed8e96b43671ad5ff3de3e4e;p=gnome-shell.git Fix compiler warnings src/shell-global.c src/shell-process.c: Remove dead code src/shell-texture-cache.c src/shell-status-menu.c: Remove _new() functions that weren't in the header file and not used anyways: src/shell-texture-cache.[ch]: Fix a prototype that used () when (void) was intended. http://bugzilla.gnome.org/show_bug.cgi?id=590998 --- diff --git a/src/shell-global.c b/src/shell-global.c index 299208887..648d1c182 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -271,49 +271,6 @@ shell_global_class_init (ShellGlobalClass *klass) G_PARAM_READABLE)); } -/** - * search_path_init: - * - * search_path_init and get_applications_search_path below were copied from glib/gio/gdesktopappinfo.c - * copyright Red Hat, Inc., written by Alex Larsson, licensed under the LGPL - * - * Return value: location of an array with user and system application directories. - */ -static gpointer -search_path_init (gpointer data) -{ - char **args = NULL; - const char * const *data_dirs; - const char *user_data_dir; - int i, length, j; - - data_dirs = g_get_system_data_dirs (); - length = g_strv_length ((char **)data_dirs); - - args = g_new (char *, length + 2); - - j = 0; - user_data_dir = g_get_user_data_dir (); - args[j++] = g_build_filename (user_data_dir, "applications", NULL); - for (i = 0; i < length; i++) - args[j++] = g_build_filename (data_dirs[i], - "applications", NULL); - args[j++] = NULL; - - return args; -} -/** - * get_applications_search_path: - * - * Return value: location of an array with user and system application directories. - */ -static const char * const * -get_applications_search_path (void) -{ - static GOnce once_init = G_ONCE_INIT; - return g_once (&once_init, search_path_init, NULL); -} - /** * shell_clutter_texture_set_from_pixbuf: * texture: #ClutterTexture to be modified diff --git a/src/shell-overflow-list.c b/src/shell-overflow-list.c index 59511803a..2e28b007f 100644 --- a/src/shell-overflow-list.c +++ b/src/shell-overflow-list.c @@ -181,7 +181,7 @@ shell_overflow_list_allocate (ClutterActor *actor, g_list_free (children); } -void +static void shell_overflow_list_paint (ClutterActor *actor) { ShellOverflowList *self = SHELL_OVERFLOW_LIST (actor); @@ -403,15 +403,16 @@ shell_overflow_list_get_actor_index (ShellOverflowList *self, { GList *children, *iter; int i; + int result; children = clutter_container_get_children (CLUTTER_CONTAINER (self)); if (children == NULL) - return NULL; + return -1; iter = g_list_nth (children, (self->priv->page) * self->priv->items_per_page); - int result = -1; + result = -1; for (i = 0; iter; iter = iter->next, i++) if (iter->data == actor) { diff --git a/src/shell-process.c b/src/shell-process.c index 76d745af4..cec76e9b7 100644 --- a/src/shell-process.c +++ b/src/shell-process.c @@ -52,8 +52,6 @@ static void shell_process_init (ShellProcess *self) static void shell_process_dispose (GObject *object) { - ShellProcess *self = (ShellProcess*)object; - G_OBJECT_CLASS (shell_process_parent_class)->dispose(object); } diff --git a/src/shell-stack.c b/src/shell-stack.c index dedd9b298..e0a5b4bc8 100644 --- a/src/shell-stack.c +++ b/src/shell-stack.c @@ -23,7 +23,6 @@ shell_stack_allocate (ClutterActor *self, const ClutterActorBox *box, ClutterAllocationFlags flags) { - ClutterGroupPrivate *priv = CLUTTER_GROUP (self)->priv; GList *children, *iter; /* chain up to set actor->allocation */ @@ -138,7 +137,6 @@ shell_stack_get_preferred_width (ClutterActor *actor, static void shell_stack_class_init (ShellStackClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); actor_class->get_preferred_width = shell_stack_get_preferred_width; diff --git a/src/shell-status-menu.c b/src/shell-status-menu.c index d00de800b..1ea6e1d7b 100644 --- a/src/shell-status-menu.c +++ b/src/shell-status-menu.c @@ -338,7 +338,7 @@ gnome_session_save_command (const char *arg) if (args[0] == NULL) return; - args[1] = arg; + args[1] = (char *)arg; args[2] = NULL; screen = gdk_screen_get_default (); @@ -635,12 +635,6 @@ shell_status_menu_class_init (ShellStatusMenuClass *klass) G_TYPE_NONE, 0); } -ShellStatusMenu * -shell_status_menu_new (void) -{ - return g_object_new (SHELL_TYPE_STATUS_MENU, NULL); -} - static void position_menu (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data) { diff --git a/src/shell-texture-cache.c b/src/shell-texture-cache.c index b079a3b9c..1b3a8d7f1 100644 --- a/src/shell-texture-cache.c +++ b/src/shell-texture-cache.c @@ -151,13 +151,6 @@ shell_texture_cache_finalize (GObject *object) G_OBJECT_CLASS (shell_texture_cache_parent_class)->finalize (object); } -ShellTextureCache* -shell_texture_cache_new () -{ - return SHELL_TEXTURE_CACHE (g_object_new (SHELL_TYPE_TEXTURE_CACHE, - NULL)); -} - typedef struct { ShellTextureCache *cache; char *uri; @@ -1030,7 +1023,7 @@ shell_texture_cache_load_recent_thumbnail (ShellTextureCache *cache, * created for a thumbnail. */ void -shell_texture_cache_unref_thumbnail (ShellTextureCache *cache, +shell_texture_cache_evict_thumbnail (ShellTextureCache *cache, int size, const char *uri) { @@ -1074,7 +1067,7 @@ static ShellTextureCache *instance = NULL; * Return value: (transfer none): The global texture cache */ ShellTextureCache* -shell_texture_cache_get_default () +shell_texture_cache_get_default (void) { if (instance == NULL) instance = g_object_new (SHELL_TYPE_TEXTURE_CACHE, NULL); diff --git a/src/shell-texture-cache.h b/src/shell-texture-cache.h index 215e28a20..d24a68128 100644 --- a/src/shell-texture-cache.h +++ b/src/shell-texture-cache.h @@ -38,7 +38,7 @@ typedef enum { GType shell_texture_cache_get_type (void) G_GNUC_CONST; -ShellTextureCache* shell_texture_cache_get_default(); +ShellTextureCache* shell_texture_cache_get_default (void); ClutterActor *shell_texture_cache_load_gicon (ShellTextureCache *cache, GIcon *icon,